package com.example.designmode.agency;

//代理对象
public class Proxy implements Souvenir{

    //组合真实类
    private Reality reality;

    //替换真实类
    public Proxy(Receiver receiver){
        reality = new Reality(receiver);
    }

    @Override
    //代理类调用真实类的职责任务 最终由代理类执行
    public void doll() {
        reality.doll();
        System.out.println("交给代理类执行送出礼物的动作 成功偷鸡");
    }
}
